package com.medi.chats.service.chats;

import com.medi.chats.dao.McChatsMapper;
import com.medi.chats.model.McChats;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 描述:
 * chat服务
 *
 * @outhor Administrator
 * @create 2018-10-25 16:12
 */
@Service
public class ChatsService {

    @Autowired
    McChatsMapper mcChatsMapper;


    public McChats selectMcChatsById(Long id) {
        return mcChatsMapper.selectByPrimaryKey(id);
    }

    public McChats getChatDetailById(Long id) {
        return mcChatsMapper.getChatDetailById(id);
    }

    public List<McChats> selectChatsSortDateDesc() {
        return mcChatsMapper.getChatsSortDateDesc();
    }

    /**
     * @Description  根据分类获取chat列表。cat： 0，全部。其余，对应的分类
     * @Author        Administrator
     * @Date          2018/11/6 19:27
    */
    public List<McChats> selectChatsByCat(Map map) {
        return mcChatsMapper.selectChatsByCat(map);
    }


}
